/**
 * @Title: Marerial.java 
 * @Description: TODO
 * @author <a href="mailto:psammead@126.com">Psammead</a>
 * @date 2011-7-16 上午10:39:25 
 * @version 1.0
 * Copyright 2011 by Psammead
 */
package com.psammead.dms.offer.entity;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.psammead.dms.common.core.bo.AbstractBaseBO;

/**
 * @ClassName: Marerial
 * @Description: TODO
 * @author <a href="mailto:psammead@126.com">psammead</a>
 * @version 1.0
 * @date 2011-7-16
 */
@Entity(name="Material")
@Table(name="tb_of_material")
public class Material extends AbstractBaseBO implements Serializable {

	/**
	 * @Fields serialVersionUID 
	 */
	private static final long serialVersionUID = -3134824628846006143L;
	private long id;
	private MaterialDefine define;
	private Offer offer;
	private int amount;
	private int sort;
	private int number;
	private String name;
	private String customize;
	private String discription;
	private String remark;
	private Double price;
	private Double cost;
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name="material_id")
	@Override
	public long getId() {
		// TODO Auto-generated method stub
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	@ManyToOne(cascade=CascadeType.ALL,optional=true)
	@JoinColumn(name="define_id")
	public MaterialDefine getDefine() {
		return define;
	}


	public void setDefine(MaterialDefine define) {
		this.define = define;
	}

	@ManyToOne(cascade=CascadeType.ALL,optional=true)
	@JoinColumn(name="offer_id")
	public Offer getOffer() {
		return offer;
	}

	public void setOffer(Offer offer) {
		this.offer = offer;
	}

	@Column(name="amount")
	public int getAmount() {
		return amount;
	}


	public void setAmount(int amount) {
		this.amount = amount;
	}

	@Column(name="sort")
	public int getSort() {
		return sort;
	}


	public void setSort(int sort) {
		this.sort = sort;
	}

	@Column(name="number")
	public int getNumber() {
		return number;
	}


	public void setNumber(int number) {
		this.number = number;
	}

	@Column(name="name")
	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}

	@Column(name="customize",length=512)
	public String getCustomize() {
		return customize;
	}


	public void setCustomize(String customize) {
		this.customize = customize;
	}

	@Column(name="discription")
	public String getDiscription() {
		return discription;
	}


	public void setDiscription(String discription) {
		this.discription = discription;
	}

	@Column(name="remark")
	public String getRemark() {
		return remark;
	}


	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name="price")
	public Double getPrice() {
		return price;
	}


	public void setPrice(Double price) {
		this.price = price;
	}

	@Column(name="cost")
	public Double getCost() {
		return cost;
	}

	public void setCost(Double cost) {
		this.cost = cost;
	}
}
